﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LPrisaMVC.Entities;
using LPrisaMVC.DAO ;
using Microsoft.Practices.Unity;

namespace LPrisaMVC.BusinessLogic
{
    public class PagoBL : IPagoBL
    {
        [Dependency]
        public IPagoDAO pagoDAO { get; set; }

        [Dependency]
        public ICreditoDAO creditoDAO { get; set; }

        [Dependency]
        public IClienteDAO clienteDAO { get; set; }

        public List<DETALLEPAGO> GetAllFromPagos()
        {
            return pagoDAO.GetAllFromPagos();
        }

        public List<DETALLEPAGO> GetFromPagobyClienteOfCredito(string cliente)
        {
            return pagoDAO.GetFromPagobyClienteOfCredito(cliente);
        }
        
        public List<DETALLEPAGO> GetFromPagosbyCreditoId(int creditoId)
        {
            return pagoDAO.GetFromPagosbyCreditoId(creditoId);
        }

        public List<DETALLEPAGO> GetFromPagobyFecha(DateTime? fec1, DateTime? fec2)
        {
            return pagoDAO.GetFromPagobyFecha(fec1, fec2);
        }

        public DETALLEPAGO GetFromPagoById(int id)
        {
            return pagoDAO.GetFromPagoById(id);
        }

        public void AddPago(DETALLEPAGO pago)
        {
            pagoDAO.AddPago(pago);
        }

        public void UpdatePago(DETALLEPAGO pago)
        {
            pagoDAO.UpdatePago(pago);
        }

        public void CancelarPago(int id)
        {
            pagoDAO.CancelarPago(id);
        }


        
    }
}
